

package com.scs.application.modules.order.vo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.scs.application.core.model.DataEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 采购订单实体对象
 *
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@Accessors(chain = true)
@ExcelTarget("purchaseOrderVO")
public class PurchaseOrderVO extends DataEntity implements Serializable {

    /**
     * 院方ID
     */
    private String hospitalId;

    /**
     * 院方名称
     */
    private String hospitalName;

    /**
     * 订单编号
     */
    @Excel(name = "订单编号", needMerge = true)
    private String code;

    /**
     * 供应商ID
     */
    @NotBlank(message = "供应商ID不能为空")
    private String supplierId;

    /**
     * 供应商名称
     */
    @Excel(name = "供应商名称", needMerge = true)
    @NotBlank(message = "供应商名称不能为空")
    @Length(min = 1, max = 100, message = "供应商名称长度必须介于 1 和 100 之间")
    private String supplierName;

    /**
     * 送达地点ID
     */
    @NotNull(message = "送达地点ID不能为空")
    private Long warehouseId;

    /**
     * 送达地点名称
     */
    // @Excel(name = "送达地点名称", needMerge = true)
    @NotBlank(message = "送达地点名称不能为空")
    @Length(min = 1, max = 50, message = "送达地点名称长度必须介于 1 和 50 之间")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private String warehouseName;

    /**
     * 是否寄售
     */
    @Excel(name = "是否寄售", dict = "common_yes_no", needMerge = true)
    @NotNull(message = "是否寄售不能为空")
    private Integer isConsignment;

    /**
     * 是否一物一码
     */
    @Excel(name = "是否一物一码", dict = "common_yes_no", needMerge = true)
    @NotNull(message = "是否一物一码不能为空")
    private Integer isOneThingOneYard;

    /**
     * 要求送达日期
     */
    @Excel(name = "要求送达日期", format = "yyyy-MM-dd", needMerge = true)
    @NotNull(message = "要求送达日期不能为空")
    private java.util.Date gmtRequireLatestDelivery;

    /**
     * 订单金额(元)
     */
    @Excel(name = "订单金额(元)", needMerge = true)
    private Double totalAmount;

    /**
     * 采购员
     */
    @Excel(name = "采购员", needMerge = true)
    private String buyerName;

    /**
     * 审核人
     */
    @Excel(name = "审核人", needMerge = true)
    private String auditorName;

    /**
     * 提交时间
     */
    @Excel(name = "提交时间", format = "yyyy-MM-dd", needMerge = true)
    private java.util.Date gmtSubmitted;

    /**
     * 审核时间
     */
    @Excel(name = "审核时间", format = "yyyy-MM-dd", needMerge = true)
    private java.util.Date gmtAudited;

    /**
     * 供应商确认状态
     */
    @Excel(name = "供应商确认状态", dict = "order_po_supplier_confirm_status", needMerge = true)
    private Integer supplierConfirmStatus;

    /**
     * 供应商确认用户
     */
    @Excel(name = "供应商确认用户", needMerge = true)
    private String supplierConfirmer;

    /**
     * 供应商确认时间
     */
    @Excel(name = "供应商确认时间", format = "yyyy-MM-dd", needMerge = true)
    private java.util.Date gmtSupplierConfirmed;

    /**
     * 发货状态
     */
    @Excel(name = "发货状态", dict = "order_po_delivery_status", needMerge = true)
    private Integer deliveryStatus;

    /**
     * 首次发货时间
     */
    @Excel(name = "首次发货时间", format = "yyyy-MM-dd", needMerge = true)
    private java.util.Date gmtFirstDelivery;

    /**
     * 订单状态
     */
    @Excel(name = "订单状态", dict = "order_po_status", needMerge = true)
    private Integer status;

    /**
     * 是否关闭
     */
    @Excel(name = "是否关闭", dict = "common_yes_no", needMerge = true)
    private Integer isClosed;

    /**
     * 关闭时间
     */
    @Excel(name = "关闭时间", format = "yyyy-MM-dd", needMerge = true)
    private java.util.Date gmtClosed;

    /**
     * 数据来源
     */
    @Excel(name = "数据来源", dict = "order_po_source", needMerge = true)
    private Integer source;

    /**
     * 来源标识
     */
    @NotBlank(message = "来源标识不能为空")
    private String sourceKey;

    @ExcelCollection(name = "订单明细")
    private List<PurchaseOrderItemVO> items;

    /**
     * 制单时间
     */
    private java.util.Date gmtCreate;

    /** 需求科室Id */
    private String demandDeptId;

    /** 需求科室名称 */
    private String demandDeptName;

    /**
     * 采购科室ID
     */
    private String purchaseDeptId;
    /**
     * 采购科室名称
     */
    private String purchaseDeptName;

}
